package com.RKB.web;

import com.RKB.pojo.threeanalysisAccuracyRate;
import com.RKB.service.AnswerResultService;
import com.RKB.service.questionbankService;
import com.RKB.service.threeAnalysisService;
import com.RKB.service.threeIdSercive;
import com.RKB.api.AjaxResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@CrossOrigin
@RestController
public class TreeAnalysisController {
    @Autowired
    private threeAnalysisService threeAnalysisservice;
    @Autowired
    private questionbankService questionbankservice;
    @Autowired
    threeIdSercive threeIdsercive;
    @Autowired
    AnswerResultService answerResultService;

    @RequestMapping("/findSimulationAccuracyRate")
    public AjaxResult<threeanalysisAccuracyRate> findSimulationAccuracyRate(String method, String uid){
        AjaxResult<threeanalysisAccuracyRate> result = new AjaxResult<>();
        threeanalysisAccuracyRate byUid = threeAnalysisservice.findByUid("simulation_Accuracy_Rate", "root");
        System.out.println(byUid);
        result.setCode(200);
        result.setMsg("success");
        result.setData(byUid);
        return result;
    }



    @RequestMapping("/findExerciseAccuracyRate")
    public AjaxResult<threeanalysisAccuracyRate> findExerciseAccuracyRate(String method,String uid){
        AjaxResult<threeanalysisAccuracyRate> result = new AjaxResult<>();
        threeanalysisAccuracyRate byUid = threeAnalysisservice.findByUid("exercise_Accuracy_Rate", "root");
        System.out.println(byUid);
        result.setCode(200);
        result.setMsg("success");
        result.setData(byUid);
        return result;
    }

    @RequestMapping("/findTestAccuracyRate")
    public AjaxResult<threeanalysisAccuracyRate> findByUid(String method,String uid){
        AjaxResult<threeanalysisAccuracyRate> result = new AjaxResult<>();
        threeanalysisAccuracyRate byUid = threeAnalysisservice.findByUid("test_Accuracy_Rate", "root");
        System.out.println(byUid);
        result.setCode(200);
        result.setMsg("success");
        result.setData(byUid);
        return result;
    }




}
